package com.hnhs.model;

import cn.hutool.core.annotation.Alias;

import com.hnhs.enums.ProductStatus;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class Product {
    private Integer id;
    private String name;
    private String subName;
    private String img;
    private Integer seq;
    private Integer price;
    private Integer status;
    @Alias("商品介绍")
    private String brief;
    private Integer categoryId;
    @Alias("最后更新人")
    private String lastUpdateBy;
    private LocalDateTime lastUpdateTime;

    //状态枚举属性
    private String statusX;

    public String getStatusX() {
        ProductStatus productStatus=ProductStatus.findByCode(this.getStatus());
        if(productStatus == null){
            return "";
        }
        return productStatus.getMsg();
    }
}
